package routes

import (
	"github.com/gin-contrib/pprof"
	"github.com/gin-gonic/gin"
	"home-bank/service/something/api/internal/handler"
	"net/http"
)

func SetupRoutes() *gin.Engine {
	r := gin.Default()
	pprof.Register(r)

	r.GET("/health", func(c *gin.Context) {
		c.JSON(http.StatusOK, gin.H{
			"message": "success",
		})
	})

	v1Group := r.Group("/api/v1")
	{
		v1Group.POST("/something", handler.CreateSomething)

		v1Group.DELETE("/something/delete", handler.DeleteSomething)

		v1Group.GET("/something/list", handler.GetSomethingList)

		v1Group.PUT("/something/update", handler.UpdateSomething)
	}

	return r
}
